/*******************************************************************************
 * @project: aohuaproject
 * @package: com.aohua.excel
 * @file: ETypeApprover.java
 * @author: fionn
 * @created: 2015年11月11日
 * @purpose:
 * 
 * @version: 1.0
 * 
 * 
 * Copyright 2015 HAND All rights reserved.
 ******************************************************************************/
package com.aohua.excel;

import java.util.HashSet;
import java.util.Set;

/**
 * @author fionn
 *
 */
public class ETypeApprover {

    private String type;
    private Set<String> approvers;
    
    /**
     * 
     */
    public ETypeApprover(String type) {
        this.type = type;
        this.approvers = new HashSet<String>();
    }
    
    public void addApprover(String approver) {
        approvers.add(approver);
    }

    /**
     * @return the type
     */
    public String getType() {
        return type;
    }

    /**
     * @return the approvers
     */
    public Set<String> getApprovers() {
        return approvers;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuffer str = new StringBuffer();
        str.append("(").append(type).append(": [");
        for(String approver :approvers) {
            str.append(approver).append(",");
        }
        str.append("])");
        return str.toString();
    }
    
    public boolean hasApprover() {
        return approvers.size() > 0;
    }
    

}
